package homework.day11;

import java.util.Collection;
import java.util.HashSet;
import java.util.Random;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 *
 * @author Xiloer
 */
public class Test03 {
    public static void main(String[] args) {
        Random rand = new Random();
        Collection<Integer> c = new HashSet<>();
        while (c.size() < 10) {
            c.add(rand.nextInt(101));
            //System.out.println("size"+c.size());
        }
        for (Integer a : c) {
            System.out.println(a);
        }
    }
}
